<div class="footer">

		<div class="footer-inner">

			2016 &copy; Admin.

		</div>

		<div class="footer-tools">

			<span class="go-top">

			<i class="icon-angle-up"></i>

			</span>

		</div>

	</div>
	<include file="public:responsive" />
	<script src="media/js/jquery-1.10.1.min.js" type="text/javascript"></script>

	<script src="media/js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>

	<!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->

	<script src="media/js/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>      

	<script src="media/js/bootstrap.min.js" type="text/javascript"></script>

	<!--[if lt IE 9]>

	<script src="media/js/excanvas.min.js"></script>

	<script src="media/js/respond.min.js"></script>  

	<![endif]-->   

	
	<script src="media/js/jquery.uniform.min.js" type="text/javascript" ></script>

	<!-- END CORE PLUGINS -->

	<!-- BEGIN PAGE LEVEL SCRIPTS -->

	<script src="media/js/app.js"></script>

	<script>

		jQuery(document).ready(function() {       

		   App.init();

		});
	
	</script>
	<if condition="(ACTION_NAME eq 'index')">
	<style>
	#pages {
		float: right;
		margin-right: 20px;
		text-align: right;
	}
	#pages a {
		background: #4d90fe none repeat scroll 0 0;
		border: 1px solid #e3e3e3;
		color: #fff;
		display: inline-block;
		height: 22px;
		line-height: 22px;
		margin-left: 4px;
		padding: 0 4px;
		text-align: center;
	}
	#pages a.current {
		background: #5a85b2 none repeat scroll 0 0;
		border: 1px solid #5a85b2;
		color: #fff;
		display: inline-block;
		height: 22px;
		line-height: 22px;
		text-align: center;
		width: 26px;
	}
	#pages a.page_prev, #pages a.page_first, #pages a.page_last, #pages a.page_next {
		background: #4d81bb none repeat scroll 0 5px;
		width: 50px;
	}
	#pages a:hover {
		background: #35aa47 none repeat scroll 0 0;
		color: #000;
		text-decoration: none;
	}
	</style>
	
	<script>
	var form_actions = '{$form_actions}'==='0'?0:1;
	if(form_actions===0){
		$('.form-actions').hide();
	}
	$('[data-refresh]').click(function(){
		var toggle = $(this).attr('data-refresh');
		$(toggle).attr('src',$(toggle).attr('src'));
	});
	$('[data-toggle="modal"]').click(function(){
		var url = $(this).attr('data-url');
		$('#mobileframe').attr('src',url);
		$('[data-refresh]').click();
	});
	
	$(function(){
		//处理状态
		$('img[data-field="status"]').click(function(){
			var val = $(this).attr('data-value')==1?0:1;
			var id = $(this).attr('data-id');
			var field = 'status';
			var obj = $(this);
			var url = "{:U(MODULE_NAME.'/ajax_edit')}"+'&id='+id+'&field='+field+'&val='+val;
			$.ajax({
				  "url": url,
				  "method": "get",
			}).success(function (data) {
				if(data.status){
					if(val){
						obj.attr({'src':'./media/image/toggle_enabled.gif','data-value':val});
					}else{
						obj.attr({'src':'./media/image/toggle_disabled.gif','data-value':val});
					}
						
				}
			})
		});
		//处理排序
		$('span[data-field]').click(function(){
			var val = $(this).html();
			var id = $(this).attr('data-id');
			var field = $(this).attr('data-field');
			var len = strlen(val) + '9';
			var txt = '<input data-field="'+field+'" data-id="'+id+'" type="text" style="width:'+len+'px" value="'+val+'"/>';
			$(this).hide().after(txt).next().focus();
		});
		$('input[data-field]').live('blur',function(){
			var val = $(this).val();
			var prev_val = $(this).prev().html();
			
			var field = $(this).attr('data-field');;
			var id = $(this).attr('data-id');
			var url = "{:U(MODULE_NAME.'/ajax_edit')}"+'&id='+id+'&field='+field+'&val='+val;
			var obj = $(this);
			//判断是否发生了值的改变
			if(val==prev_val){
				obj.prev().show().html(val);
				obj.remove();
				return false;
			}
			$.ajax({
				  "url": url,
				  "method": "get",
			}).success(function (data) {
				if(data.status==1){
					if(val==''){
						obj.prev().removeClass('blue').addClass('yellow');
					}else{
						obj.prev().removeClass('yellow').addClass('blue');
					}
					obj.prev().show().html(val);
					obj.remove();
				}else{
					alert(data.msg);
				}
			})
		});
	});
	
	//处理tooltips样式
	$('.form-actions .control-group button').addClass('tooltips').attr({'data-placement':'top','data-original-title':'可以删除多个选中的选项'});
	$('#sample_1 td a[class="btn red"]').addClass('tooltips').attr({'data-placement':'right','data-original-title':'可以删除该选项'});
	$('#sample_1 td a[class="btn green"]').addClass('tooltips').attr({'data-placement':'top','data-original-title':'进入修改该选项'});
	$('span[data-field]').addClass('tooltips').attr({'data-placement':'top','data-original-title':'单击进入修改该选项'});
	$('img[data-field]').addClass('tooltips').attr({'data-placement':'top','data-original-title':'单击直接修改该选项'});
	$('span[data-field]').each(function(){
		if($(this).html() != ''){
			$(this).addClass('btn mini blue');
		}else{
			$(this).addClass('btn mini yellow');
		}
		
	});
	
	function del(id){
		if(!id){
			return false;
		}
		question = confirm("确实删除吗?"); 

		if (question !="0"){
		var url = "{:U(MODULE_NAME.'/delete',array('menuid'=>$_GET['menuid'],'menupid'=>$_GET['menupid'],'class_list_id'=>$_GET['class_list_id'],'id'=>''))}"+id;
		//alert(url);
			location.href=url;
		}
	}
	function select_input(){
	var i = $("#selectall").attr('checked');
		if(i) {
			selectAll();
		}else{
			re_selectAll();
		}	
	}
	function re_select_input(){
	var i = $("#selectall").attr('checked');
		if(i) {
			re_selectAll();
		}else{
			selectAll();
		}	
	}
	function selectAll(){
		$("input[type='checkbox']").each( function() {
			$(this).attr('checked', true);
			$(this).parents('.checker').find('span').addClass('checked');
		});
	}
	function re_selectAll(){
		$("input[type='checkbox']").each( function() {
			$(this).removeAttr('checked');
			$(this).parents('.checker').find('span').removeClass('checked');
		});
	}
	
	
	function submit_select_input(){
		
		var ids='';
		$("input[type='checkbox']").each( function() {
			i = $(this).parents('.checker').find('span').attr('class');
			if(i){
				v = $(this).val();
				if(v>0){
					if(ids){
						ids = ids + ',' + v;
					}else{
						ids = v;
					}
				}
				
			}
		});
		
		del(ids);
	}
	function strlen(str){
		var len = 0;
		for (var i=0; i<str.length; i++) {
			var c = str.charCodeAt(i);
			//单字节加1
			if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) {
				len++;
			}
			else {
				len+=2;
			}
		}
		return len;
	}
	</script>
	</if>
	<!-- BEGIN FOOTER -->
	<include file="public:validate" />
	<!-- END FOOTER -->